Public Class OptionsFRM

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If UseMore.Checked = True Then
            My.Settings.DictNum = 1
        Else : My.Settings.DictNum = 2
        End If
        My.Settings.MinWords = minletters.Value
        My.Settings.MaxWords = Maxletters.Value
        Me.Close()
    End Sub

    Private Sub UseMore_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UseMore.CheckedChanged
        If UseMore.Checked = False Then
            Maxletters.Maximum = 21
        Else : Maxletters.Maximum = 30
        End If
    End Sub

    Private Sub minletters_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles minletters.ValueChanged
        Maxletters.Minimum = minletters.Value + 1
    End Sub

    Private Sub Maxletters_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Maxletters.ValueChanged
        minletters.Maximum = Maxletters.Value - 1
    End Sub

    Private Sub OptionsFRM_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.DictNum = 1 Then
            UseMore.Checked = True
        Else : UseMore.Checked = False
        End If
        minletters.Value = My.Settings.MinWords
        Maxletters.Value = My.Settings.MaxWords
    End Sub
End Class